package com.sky.mapper;



import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据DishId查询
     * @param ids
     * @return
     */
    List<Long> getByDishId(List<Long> ids);

    /**
     * 添加方法
     * @param setmealDishesList
     */
    void add(List<SetmealDish> setmealDishesList);

    /**
     * 根据setmealId删除套餐,菜品关联数据
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);

    /**
     * 根据套餐id查询setmeal_dish
     * @param setmealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBYSetmealId(Long setmealId);
}
